All Questions
Tagged with queuedata-structures
8 questions
0votes
1answer
234views
Are self-written queues and linked lists really worth it (better than built-in arrays)?
Let's say I need a queue for my project and the language I use does not have a built-in queue structure. So I decided to implement one myself. So I create an object with elements positions as the ...
3votes
4answers
2kviews
Iterating through stacks and queues?
Are stacks and queues allowed to be iterated over, conceptually? It “feels wrong” for some reason but I can't come up with a reason why it would be bad to see through the whole thing that's stacked/...
-3votes
3answers
789views
Priority Queue and Set in Java or general
why do we need priority queue when a set always keeps its object sorted, I think we can always remove the first/last element of a set and it would work as priority queue because priority queue offers ...
6votes
3answers
1kviews
Large doubly-linked-list (or other) storage on disk for queue system; options for how to store
I'm looking at building a message queuing library in Go, which will be used as part of a larger application. A doubly-linked-list seems like a sensible approach for an in-memory data structure, but ...
10votes
2answers
3kviews
How to best design a job queue with constraints?
Consider the following situation: You have a program which creates numerous 'jobs' that need to be processed and places them into a queue. You have other worker programs which grab the next 'job' in ...
3votes
1answer
34kviews
How to remove a middle element from queue?
I had a question, about how to remove an element from middle of the queue , without disturbing the order of other elements. E.g. Queue before operation:- <| a b c d e |< Queue after ...
3votes
2answers
8kviews
How to increase the efficiency of an Immutable Queue in java?
I have been developing an Immutable queue in java, but the version I have developed is supposedly slow and I have been suggested to create a faster version of the same and I have no idea as to how to ...
9votes
13answers
38kviews
What are some good, simple examples for queues? [closed]
I'm teaching CS2 (Java and data structures), and am having some difficulty coming up with good examples to use when teaching queues. The two major applications I use them for are multithreaded message ...